package com.neuedu.homework;

public class SalariedEmployee extends ColaEmployee {
    //成员变量
    //月薪
    private double monthSalary;

    //行为方法

    //重写父类的方法计算当前子类的工资
    @Override
    public double getSalary(int month) {
        //计算员工工资：当前工资+生日金
        double mySalary=monthSalary+super.getSalary(month);
        return mySalary;
    }


    public SalariedEmployee(String empName, int empBirthdayMonth, double monthSalary) {
        //通过super调用父类的构造方法
        super(empName, empBirthdayMonth);
        this.monthSalary = monthSalary;
    }

    public SalariedEmployee(){

    }

    public double getMonthSalary() {
        return monthSalary;
    }

    public void setMonthSalary(double monthSalary) {
        this.monthSalary = monthSalary;
    }
}
